package cn.quevo.ucenter.server.dao.impl;

import org.springframework.stereotype.Repository;

import cn.quevo.beetlsql.BasicDao;
import cn.quevo.core.exception.CustomException;
import cn.quevo.ucenter.core.entity.User;
import cn.quevo.ucenter.server.dao.UserDao;
import cn.quevo.ucenter.server.entity.query.UserQuery;

@Repository("userDao")
public class UserDaoImpl extends BasicDao<User, UserQuery> implements UserDao {
    private final static String SQL_PRE = "ucenter.server.user.";

    @Override
    public User getSinge(UserQuery userQuery) throws CustomException {
        return super.getSinge(userQuery, User.class);
    }
    
    @Override
    public Integer delete(User user) throws CustomException {
        return super.getBeetlSqlFactory().updateObject(SQL_PRE+"delete", user);
    }
    
    @Override
    public String getSqlPre() {
        return SQL_PRE;
    }

}
